package com.wwdeng.smart.base

import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

/**
 * android
 * @Author：wwdeng
 * @CreateTime：2024/9/16 17:38
 * <pre>
 * Fragment基类
 * </pre>
 */
abstract class BaseFm: Fragment(),IBaseView {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return getRootView()
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        initView()
        initListener()
        initData()
    }

    override fun getContext(): Context? {
        return activity
    }

    abstract fun getRootView(): View

    abstract fun initView()

    abstract fun initListener()

    abstract fun initData()
}